package com.eling.elcms.basedoc.model;

import com.eling.elcms.community.model.Organization;
import com.eling.elcms.core.model.BaseModel;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;

import javax.persistence.*;

/**
 * 小区机构关系
 * @author Wen
 */
@Entity
@Indexed
@Table(name = "bd_com_org_relation")

public class ComOrgRelation extends BaseModel {

	private static final long serialVersionUID = -4059574260346260865L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long pkComOrgRelation;
	
	 /** 机构 */
    @ManyToOne
    @JoinColumn(name = "pkOrganization")
    @IndexedEmbedded(depth = 1)
    private Organization organization;
    
    /** 所属小区 */
	@ManyToOne
	@JoinColumn(name = "pkCommunityData")
	@IndexedEmbedded
	private CommunityData communityData;
	
	@Version
	private Integer version;

	public Long getPkComOrgRelation() {
		return pkComOrgRelation;
	}

	public void setPkComOrgRelation(Long pkComOrgRelation) {
		this.pkComOrgRelation = pkComOrgRelation;
	}

	public Organization getOrganization() {
		return organization;
	}

	public void setOrganization(Organization organization) {
		this.organization = organization;
	}

	public CommunityData getCommunityData() {
		return communityData;
	}

	public void setCommunityData(CommunityData communityData) {
		this.communityData = communityData;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}
	
	
	
}
